/**
 * Created by lins on 2018/07/13.
 */
angular.module('MetronicApp').controller("InformationViewController",
    ['$rootScope', '$scope', '$state','$location', '$stateParams', 'toastr', 'InformationService',
        function ($rootScope, $scope,$state, $location, $stateParams, toastr, InformationService) {
            $scope.$on('$viewContentLoaded', function () {
                App.initAjax();
                $rootScope.settings.layout.pageBodySolid = true;
                $rootScope.settings.layout.pageSidebarClosed = false;
            });
            $scope.id = $stateParams.id;

            $scope.tabItemList = [
                {
                    "name": "标签体系",
                    "router": "labelSystemList",
                    "selected": false
                },
                {
                    "name": "企业信息",
                    "router": "informationList",
                    "selected": true
                },
                {
                    "name": "挖掘算法",
                    "router": "algorithmList",
                    "selected": false
                },
                {
                    "name": "企业画像",
                    "router": "businessPortraitList",
                    "selected": false
                },
                {
                    "name": "标签检索",
                    "router": "labelRetrievalList",
                    "selected": false
                }
            ]
            //详情
            if ($scope.id) {
                InformationService.get($scope.id).$promise.then(function (result) {
                    $scope.model = result.data;
                });
            }

            //返回
            $scope.back = function () {
                // $state.go("informationList", {type: $scope.type, index: $scope.index});
                $state.go("informationList");
            };
        }
    ]
);